Animating an object for the duration of its lifetime
When you animate an object for the duration of its lifetime, the animation starts when the object is attached to the project graph, and runs for as long as the object is attached to the project graph.
To animate objects for the duration of their lifetime:
- In the Project select or create the object you want to animate.
For example, create an Image Layer.
- In the Library select or create a timeline sequence with a timeline entry, and an animation clip:
- Right-click Animations > Timeline Sequences and select Create Timeline Sequence.
- Right-click the timeline sequence and select Create > Timeline Entry.
- Right-click the timeline entry and select Create > Animation Clip.
- In the Library select the timeline entry, and in the Properties set Repeat Count property to Infinite.

- In the Library double-click the animation clip, and in the Animation Clip Editor enter in the Current Time the time at which you want your animation to start.
For example, enter 0 to start the animation immediately when the object is attached to the project graph.

- In the Project select the object you are animating, and from the Properties drag the property you want to animate to the Animation Clip Editor.
For example, to animate the rotation of the Image Layer, add Layer Render Transform property and drag the property to the Animation Clip Editor.

Kanzi Studio creates Animation Data for each Transformation property of the object you are animating, and adds a keyframe for each Transformation property value at the value you selected as the Current Time.

- In the Animation Clip Editor enter in the Current Time the time at which you want to end the animation, or create a new keyframe, in the Properties change the property value of the property you want to animate, and drag it to the Animation Clip Editor.
Kanzi Studio adds the new Transformation property values to the Animation Data.
Repeat this step as many times as you want to add keyframes to your animation.

- In the Project select the object you are animating, in the Properties, click Add Triggers, and add Node Attached to Graph message.

- In the Properties click the drop-down menu, and select the Play Animation action.
The Message Editor opens.

- In the Message Editor set the Animation property to the animation clip that animates your object.

- Click Play in the Kanzi Studio timeline to play the animation. See Controlling your application in the Preview.

See also
Creating a simple animation
Animating movement
Animating property values
Changing the interpolation mode between keyframes
Editing animation clips
Editing timeline sequences
Animations best practices
Animations
Open topic with navigation